<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
    <h:head>
        <title>MeteoCal - User Registration</title>
        <link rel="stylesheet" type="text/css" href="${request.contextPath}/resources/css/main.css" />
    </h:head>
    <h:body>
        <p:layout fullPage="true">
            <p:layoutUnit position="north" size="60" resizable="false" closable="false" collapsible="false">
                <ui:include src="/includes/header.xhtml"/>
            </p:layoutUnit>
            <p:layoutUnit position="center" class="content">
                <h1>User Registration</h1>
                <h:form>
                    <h:panelGrid columns="2">
                        <p:outputLabel value="First name:" for="userFirstName" />
                        <p:inputText id="userFirstName" value="#{register.userFirstName}"/>

                        <p:outputLabel value="Last name:" for="userLastName" />
                        <p:inputText id="userLastName" value="#{register.userLastName}"/>
                        
                        <p:outputLabel value="Job Title:" for="userJobTitle" />
                        <p:inputText id="userJobTitle" value="#{register.userJobTitle}"/>
                        
                        <p:outputLabel value="E-mail:" for="userEmail" />
                        <p:inputText id="userEmail" value="#{register.userEmail}"/>

                        <p:outputLabel value="Password:" for="userPassword" />
                        <p:password id="userPassword" value="#{register.userPassword}"/>
                        
                        <p:outputLabel value="Repeat password:" for="userPassword2" />
                        <p:password id="userPassword2" value="#{register.userPassword2}"/>
                        
                        <h:outputText value="" />
                        <!--TODO: add action to the button-->
                        <p:commandButton type="submit" value="Sign up" action="#{register.registerToSystem()}" ajax="false" />
                    </h:panelGrid>
                </h:form>
            </p:layoutUnit>
            <p:layoutUnit position="south" size="80" resizable="false" closable="false" collapsible="false">
                <ui:include src="/includes/footer.xhtml"/>
            </p:layoutUnit>
        </p:layout>
    </h:body>
</html>